//
//  PDMainMenuCell.m
//  Pudding
//
//  Created by baxiang on 16/9/24.
//  Copyright © 2016年 Zhi Kuiyu. All rights reserved.
//

#import "PDMainMenuCell.h"

@interface PDMainMenuCell()
@property (nonatomic,weak) UIImageView *menuImageView;
@property (nonatomic,weak) UILabel *menuTitle;
@end
@implementation PDMainMenuCell

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        UIImageView *menuImageView = [UIImageView new];
        [self.contentView addSubview:menuImageView];
        menuImageView.contentMode = UIViewContentModeScaleAspectFit;
        [menuImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.mas_equalTo(self.contentView.mas_centerX);
            make.top.mas_equalTo(0);
            make.width.height.mas_equalTo(self.contentView.mas_width);
        }];
        self.menuImageView = menuImageView;
        UILabel *menuTitle = [UILabel new];
        menuTitle.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:menuTitle];
        [menuTitle mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(menuImageView.mas_bottom).offset(10);
            make.centerX.mas_equalTo(self.contentView.mas_centerX);
        }];
       
        menuTitle.font = [UIFont systemFontOfSize:13];
        
        menuTitle.textColor = UIColorHex(0x9b9b9b);
        self.menuTitle = menuTitle;
      
     
    }
    return self;
}

-(void)setAlbumModel:(RBAlbumModel *)albumModel
{
    _albumModel = albumModel;
    [self.menuImageView yy_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",albumModel.thumb]] options:YYWebImageOptionProgressive];
    self.menuTitle.text = albumModel.title;
}



@end
